package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallGoodsCategory;
import com.appkubes.mall.core.po.MallGoodsCategoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallGoodsCategoryMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsCategorySqlProvider.class, method="countByExample")
    long countByExample(MallGoodsCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallGoodsCategorySqlProvider.class, method="deleteByExample")
    int deleteByExample(MallGoodsCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_goods_category",
        "where category_key = #{categoryKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String categoryKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_goods_category (category_key, app_key, ",
        "`name`, `state`, create_time, ",
        "update_time, sort, ",
        "recommend, cate_img, ",
        "`type`, version)",
        "values (#{categoryKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, ",
        "#{recommend,jdbcType=BIT}, #{cateImg,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=INTEGER}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallGoodsCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallGoodsCategorySqlProvider.class, method="insertSelective")
    int insertSelective(MallGoodsCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsCategorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="category_key", property="categoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="recommend", property="recommend", jdbcType=JdbcType.BIT),
        @Result(column="cate_img", property="cateImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallGoodsCategory> selectByExampleWithRowbounds(MallGoodsCategoryExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallGoodsCategorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="category_key", property="categoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="recommend", property="recommend", jdbcType=JdbcType.BIT),
        @Result(column="cate_img", property="cateImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallGoodsCategory> selectByExample(MallGoodsCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "category_key, app_key, `name`, `state`, create_time, update_time, sort, recommend, ",
        "cate_img, `type`, version",
        "from mall_goods_category",
        "where category_key = #{categoryKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="category_key", property="categoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
        @Result(column="recommend", property="recommend", jdbcType=JdbcType.BIT),
        @Result(column="cate_img", property="cateImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallGoodsCategory selectByPrimaryKey(String categoryKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsCategorySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallGoodsCategory record, @Param("example") MallGoodsCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsCategorySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallGoodsCategory record, @Param("example") MallGoodsCategoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallGoodsCategorySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallGoodsCategory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_goods_category
     *
     * @mbg.generated
     */
    @Update({
        "update mall_goods_category",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "`state` = #{state,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "sort = #{sort,jdbcType=INTEGER},",
          "recommend = #{recommend,jdbcType=BIT},",
          "cate_img = #{cateImg,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where category_key = #{categoryKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallGoodsCategory record);
}